package java_thinking.unit_14._14_3;

import java_thinking.unit_14.pets.Pet;
import java_thinking.unit_14.pets.PetCreator;

import java.util.ArrayList;

/**
 * @Description :   使用字面常量
 * @author: cww
 * @DateTime: 2019-03-28 23:54
 */

public class Pets {

    public static final PetCreator creator = new LiteralPetCreator();
    public static Pet randomPet() {
        return creator.randomPet();
    }
    public static Pet[] createArray(int size){
        return creator.createArray(size);
    }
    public static ArrayList<Pet> arrayList(int size){
        return creator.arrayList(size);
    }
}

class PetCount2 {
    public static void main(String[] args) {
        PetCount.countPets(Pets.creator);
    }
}